﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class gridviews_clientesGrid : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        imgbt_cancelar.Attributes.Add("OnClick", "javascript:cancelar();");
    }

    protected void GridViewf_OnRowCommand(Object sender, GridViewCommandEventArgs e)
    {
        if (e.CommandName == "Aceptar")
        {
            GridClientes.SelectedIndex = Convert.ToInt32(e.CommandArgument);
            Response.Write("<SCRIPT language=\"javascript\"> window.opener.retornaCodigoCliente(\"" + GridClientes.SelectedRow.Cells[0].Text + "\");</script>");
            Response.Write("<SCRIPT language=\"javascript\"> window.opener.retornaNombreCliente(\"" + GridClientes.SelectedRow.Cells[1].Text +""+ GridClientes.SelectedRow.Cells[2].Text + "\");</script>");
            Response.Write("<SCRIPT language=\"javascript\"> window.close();</script>");

        }
    }

    protected void imgbt_buscar_Click(object sender, ImageClickEventArgs e)
    {
        GridClientes.DataBind();
    }
}
